import React from 'react';
import { Button, Form, Input, Modal } from 'antd';
import { connect } from 'umi';
const { confirm } = Modal;

class VaccinesEdit extends React.Component<any, any> {
  constructor(props: any) {
    super(props);
    this.state = {
      loading: false,
      datas: {},
      imageUrl: '',
      imgList: [],
    };
  }
  formRef: any = React.createRef();
  componentDidMount() {}

  handleSubmit = async (values: any) => {
    console.log(values);
    const {onSubmit} = this.props
    if(typeof onSubmit === 'function'){
        onSubmit({...values})
    }
  };    
  render() {
    const {} = this.state;
    const layout = {
      labelCol: { span: 6 },
      wrapperCol: { span: 17 },
    };
    const { onCancel } = this.props;
    console.log(this.props);

    return (
      <>
        <Modal
          title="导出兑换码"
          visible={this.props.visible}
          onCancel={onCancel}
          footer={null}
          destroyOnClose
        >
          <Form ref={this.formRef} layout="vertical" onFinish={this.handleSubmit} {...layout}>
            <Form.Item name="fileName" label="导出文件名">
              <Input placeholder="请输入导出文件名" />
            </Form.Item>
            <Form.Item>
            <Button type="primary" htmlType="submit">
              确认
            </Button>
            </Form.Item>
          </Form>
        </Modal>
      </>
    );
  }
}
export default connect(({ Abp, Category }: API.IConnectState) => ({
  response: Abp.response,
  currentUser: Abp.currentUser,
  Category,
}))(VaccinesEdit);
